package com.csi.service.impl;

import com.csi.dao.impl.InformationDaoImpl;
import com.csi.dao.InformationDao;
import com.csi.domain.Information;
import com.csi.service.InformationService;

import java.sql.SQLException;

public class InformationServiceImpl implements InformationService {
    @Override
    public Information findAll()  {
        InformationDao informationDao=new InformationDaoImpl();
        Information all = null;
        try {
            all = informationDao.findAll();
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        return all;
    }

    @Override
    public int update(Information information)  {
        InformationDao informationDao=new InformationDaoImpl();
        int update = 0;
        try {
            update = informationDao.update(information);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        return update;
    }
}
